#include <QGraphicsTextItem>

#include <UIKit/UIApplication.h>
#include <UIKit/UIWebView.h>
#include <UIKit/UIWindow.h>
#include <UIKit/UIDevice.h>
#include <UIKit/UIFont.h>

#include "MainViewController.h"

MainViewController::MainViewController (QObject *parent)
    : UIViewController(parent)
{
    UIDevice *device = UIDevice::currentDevice();
    device->beginGeneratingDeviceOrientationNotifications();
}

MainViewController::~MainViewController() {
}

void MainViewController::viewDidLoad (void) {
    UIWindow *window = new UIWindow;
    UIApplication::sharedApplication()->setKeyWindow(window);

    m_webView = new UIWebView;
    //m_webView->load(QUrl("http://www.apple.com/macosx"));
    m_webView->load(QUrl("http://mail.google.com"));
    window->addItem(m_webView);

    orientationChanged();
}

void MainViewController::viewDidUnload (void) {
}

void MainViewController::orientationChanged (void) {
    m_webView->resize(kUIDeviceScreenSize);
}

bool MainViewController::shouldAutorotate (UIInterfaceOrientation orientation) const {
    Q_UNUSED(orientation)
    return(true);
}


